import request from '@/config/axios'

// 发布策略 VO
export interface StrategyVO {
  id: number // 主键
  scopeId: number // 授权ID
  intensity: number // 烈度
  magnitude: number // 震级
  area: string // 地区
  keywords: string // 关键字
  coordinates: string // 坐标范围
}

// 发布策略 API
export const StrategyApi = {
  // 查询发布策略分页
  getStrategyPage: async (params: any) => {
    return await request.get({ url: `/forward/strategy/page`, params })
  },

  // 查询发布策略详情
  getStrategy: async (id: number) => {
    return await request.get({ url: `/forward/strategy/get?id=` + id })
  },

  // 新增发布策略
  createStrategy: async (data: StrategyVO) => {
    return await request.post({ url: `/forward/strategy/create`, data })
  },

  // 修改发布策略
  updateStrategy: async (data: StrategyVO) => {
    return await request.put({ url: `/forward/strategy/update`, data })
  },

  // 删除发布策略
  deleteStrategy: async (id: number) => {
    return await request.delete({ url: `/forward/strategy/delete?id=` + id })
  },

  // 导出发布策略 Excel
  exportStrategy: async (params) => {
    return await request.download({ url: `/forward/strategy/export-excel`, params })
  },
}